Information can be obtained from tables in a database using queries expressed in a database query language, such as Structured Query Language (SQL). The query is translated into an internal representation by a compiler of a database management system. This internal representation is interpreted by a runtime processor of the database management system to execute the query. Access to information in the database may be controlled according to a classification of both the tables and the user attempting to access the tables. For example, a user can only gain access to a specific table if the user's classification is such that access to the specific table is permitted based on the table's classification. The table's classification may be based on the entire table or on individual elements in each table (e.g. rows) with elements being classified to provide access to elements and not the entire table. The additional classifications produce complexities in classification management and tracking which may be governed by a system external to the database management system.
Compilers use various optimization techniques to minimize the time and computer resources used for execution of the internal representation of the query. The compiler determines an efficient access plan to satisfy the query by examining table information and related statistics. Controlling access to elements based on user and table classifications may involve integrating with an external system. Such integration during execution of the query often increases execution time, especially if such information is not readily available.